function validateEmail(field){
    var emailRegEx =/^([a-zA-Z0-9])(([a-zA-Z0-9])*([\._-])?([a-zA-Z0-9]))*@(([a-zA-Z0-9\-])+(\.))+([a-zA-Z]{2,4})+$/;

    var val = document.getElementById(field);

    if (val.value.search(emailRegEx )==-1){

        val.focus();
        return false;
    }
    else{
        return true;
    }
}

function validateNumeric(field){
    var entry = document.getElementById(field);
    var re = /^(-{0,1}\d{1,3},(\d{3},)*\d{3}(\.\d{1,4})?|-{0,1}\d{1,3}(\.\d{1,4})?|-{0,1}\d+(\.\d{1,4})?)$/;
    if(re.test(entry.value)){
        return true;
    }else{
        entry.focus();
        return false;
    }
    return true;
}

function validateAlphabetic(field){

    var entry = document.getElementById(field);
    var alphabetic =/^([A-Za-z\s]+)$/;
    var strlen = entry.value.length;

    if(!alphabetic.test(entry.value)){
        entry.focus();
        return false;
    }
  
    if(strlen == 0){
        return false;
    }
    return true;
}

function validateAlphaNumeric(field){

    var entry = document.getElementById(field);

    var re =/^([A-Za-z0-9\s]+)$/ ;
    if(re.test(entry.value)){
        return true;
    }else{
        entry.focus();
        return false;
    }

    if(strlen == 0){
        return false;
    }
    return true;
}

function validateExpression(field,expression){
    var entry = document.getElementById(field);

    re = new RegExp(expression) ;

    if(re.test(entry.value)){
        return true;
    }else{
        entry.focus();
        return false;
    }

    return true;
}

function validateNonEmpty(field){
    var entry = document.getElementById(field);

    var strlen = entry.value.length;

    if(strlen == 0){
        entry.focus();
        return false;
    }

    return true;
}